From 89d1f8c3ca3a046569acebd1392211652e216e8a Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 26 Apr 2019 23:48:13 +0000 Subject: [PATCH] window: Set cursor on the right surface Set the cursor on the surface of the target widget, not the surface of some of its parents. This does not make a difference currently. But it will in the future, when we have parented widgets with surfaces. --- gtk/gtkwindow.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 0fdb869bc7..04c1decdfb 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -9876,6 +9876,9 @@ update_cursor (GtkWindow *toplevel, GtkWidget *target) { GdkCursor *cursor = NULL; + GdkSurface *surface; + + surface = gtk_widget_get_surface (target); if (grab_widget && !gtk_widget_is_ancestor (target, grab_widget)) { @@ -9903,8 +9906,7 @@ update_cursor (GtkWindow *toplevel, } } - gdk_surface_set_device_cursor (gtk_widget_get_surface (GTK_WIDGET (toplevel)), - device, cursor); + gdk_surface_set_device_cursor (surface, device, cursor); } void -- 2.30.2